<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .box {
            width: 100%;
            height: 100vh;
            background-color: rgba(0, 0, 0);
            text-align: center;
            line-height: 100vh;
            font-size: 100px;
            color: rgb(255, 255, 255);
        }

        .btn {
            position: absolute;
            bottom: 30%;
            left: calc(50% - 100px);
            width: 200px;
            height: 100px;
            background-color: red;
        }
    </style>
</head>

<body>
    <div class="box">******</div>
    <button class="btn">改变颜色</button>
    <script>
        var box = document.getElementsByClassName('box')[0]
        var btn = document.getElementsByClassName('btn')[0]
        var names = [
            "甘大鹏", "廖亿城", "邓新宇", "徐正洋", "丁俊豪", "蒋金平", "李健", "廖伟鑫", "施雅典", "沈江余", "付锦铭", "罗志强", "董杨兴", "李伟"
        ]
        var time = null
        function GetRandom(min, max) {
            return Math.floor(Math.random() * (max - min + 1) + min)
        }
        console.log(GetRandom(1, 5));//
        btn.onclick = () => {
            var r = Math.floor(Math.random() * 255);
            var g = Math.floor(Math.random() * 255);
            var b = Math.floor(Math.random() * 255);
            var a = Math.random();
            console.log(r, g, b, a)

            var Random = GetRandom(0, names.length - 1)
            box.style.backgroundColor = `rgba(${r},${g},${b},${a})`;
            box.innerHTML = `${names[Random]}`
            box.style.color = `rgb(${g},${r},${b})`
        }
    </script>
</body>

</html>